package com.isometricProjectionExmaple
{
	public class DrawnIsoBox extends DrawnIsoTile
	{
		public function DrawnIsoBox(size:Number, color:uint, h:Number=0)
		{
			super(size, color, h);
		}
		
		override protected function draw():void
		{
			this.graphics.clear();
			var red:int = this._color>>16;
			var green:int = this._color>>8 & 0xff;
			var bule:int = this._color&0xff;
			
			var leftShadow:uint = (red*0.5)<<16|(green*0.5)<<8|(bule*0.5);
			var rightShadow:uint = (red*0.75)<<16|(green*0.75)<<8|(bule*0.75);
			var h:Number = this._height * IsoUtils.Y_CORRECT;
			//var h:Number = this._height;
			
			//draw top
			this.graphics.beginFill(this._color);
			this.graphics.lineStyle(0,0,0.5);
			this.graphics.moveTo(-size,-h);
			this.graphics.lineTo(0,-size *0.5-h);
			this.graphics.lineTo(size,-h);
			this.graphics.lineTo(0,size*0.5-h);
			this.graphics.lineTo(-size,-h);
			this.graphics.endFill();
			
			//draw left
			this.graphics.beginFill(leftShadow);
			this.graphics.lineStyle(0,0,0.5);
			this.graphics.moveTo(-size,-h);
			this.graphics.lineTo(0,size *0.5-h);
			this.graphics.lineTo(0,_size *0.5);
			this.graphics.lineTo(-size,0);
			this.graphics.lineTo(-size,-h);
			this.graphics.endFill();
			
			//draw right
			this.graphics.beginFill(rightShadow);
			this.graphics.lineStyle(0,0,0.5);
			
			this.graphics.moveTo(size,-h);
			this.graphics.lineTo(0,size *0.5-h);
			this.graphics.lineTo(0,_size *0.5);
			this.graphics.lineTo(size,0);
			this.graphics.lineTo(size,-h);
			this.graphics.endFill();
		}
	}
}